package com.scarecrow.olga.error {
	/**
	 * ...
	 * @author Santiago.J.Elizalde
	 */
	public class VerboseError extends Error {
		
		private static var header:String = "---------------------------- [ERROR REPORT] -------------------------------" + "\n";
		private static var footer:String = "---------------------------------------------------------------------------" + "\n";
		private static var errorPrefix:String = "| ERROR : ";
		private static var causePrefix:String = "| CAUSE : ";
		
		public function VerboseError(error:String, cause:String, extras:Object=null) {
			var fullMessage:String;
			fullMessage = VerboseError.header;
			fullMessage += VerboseError.errorPrefix + error + "\n";
			fullMessage += VerboseError.causePrefix + cause + "\n";
			
			if(extras) {
				for (var extra:String in extras) {
					fullMessage += "| " + extra  + " = " + extras[extra] + "\n";
				}
			}
			
			fullMessage += VerboseError.footer;
			super(fullMessage);
		}
	}
}